package cn.cubix.flow.mapper;

import cn.cubix.flow.entity.WfPrms;
import cn.cubix.flow.entity.WfPrmsActive;
import cn.cubix.flow.entity.WfPrmsUser;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface WfPrmsUserMapper extends BaseMapper<WfPrmsUser> {
    Page<WfPrmsUser> pageByUserId(Page<WfPrmsUser> page, @Param("userId")String userId, @Param(Constants.WRAPPER) Wrapper<WfPrms> ew);
    Page<WfPrms> pagePrmsAvailable(Page<WfPrms> page, @Param("userId")String userId, @Param(Constants.WRAPPER) Wrapper<WfPrms> ew);
    List<WfPrmsActive> activePrms(@Param("userId")String userId);
    Page<Map<String,Object>> allocatedPrms(Page<Map<String,Object>> page, @Param("userId")String userId, @Param(Constants.WRAPPER) Wrapper<WfPrms> ew);
}
